Control Properties

Each Control has a set of Properties which allow you to configure the appearance and behaviour of the Control. Some Properties can be accessed directly within your Scripts wherever you can use a variable.

 

Properties are specified using the following case-insensitive format:

ControlName.Property

e.g.: FullName.width = FirstName.width + Surname.width

In this example, setting the width of the FullName Control will immediately change the width of the Control displayed on the device.

 

You can also use this format within an IF statement or as a parameter to a Method, e.g.:

If FirstName.text = "Ann" Then

Dim Name = "Hello " & FirstName.text

MsgBox(Name,"info")

Else

MsgBox(FirstName.text)

End If

 

If you prefer, you can store the Control's name within a variable and use that in place of the Control's name:

Dim Controlname = "FullName"

Controlname.width = 20

 

In addition, you can use the shortcut 'Me' to refer to the Control which is running the Script instead of having to use the Control's name. For example, suppose you have a Script assigned to a button's OnClick Event and when that button is clicked you want the button's label to change from 'Add' to 'Edit'. You could do this within the Script which runs from the OnClick Event by using the text Property as follows:

Me.text = "Edit"

Similarly, when a timer control's OnTimer Event is raised, you could disable the calling timer from a Script assigned to the OnTimer Event, by including the following code:

Me.enabled = "False"

 

The following Properties can be accessed directly in your Scripts:

Property

Availability

Description

bottom

All Controls

Y coordinate in pixels, or on Android devices in Device Independent Pixels (DIP), for the bottom edge of the Control. Read-only.

Enabled

All Controls, except Static Text

Value indicating whether the Control is enabled ("True" or "False").

 

Height

All Controls

Height of the Control in pixels, or on Android devices in Device Independent Pixels (DIP).

Note that with Check Box and Radio Button Controls, the height of the Control doesn't affect the size of the check box or radio button itself. With Slider Controls on Apple and Windows Desktop Platforms, you can also change the height of the overall control, but the height of the slider itself remains unchanged.

 

left

All Controls

X coordinate in pixels, or on Android devices in Device Independent Pixels (DIP), for the left edge of the Control.

 

Max

Progress Control, Slider Control and Edit Control with spinner enabled

Maximum numeric value.

 

 

Edit Control without spinner enabled

Maximum number of characters. Set to 0 (zero) for no restriction.

 

min

Progress Control, Slider Control and Edit Control with spinner enabled

Minimum numeric value.

 

readonly

Edit Control with or without spinner enabled

Specifies whether the Control is read-only:

"True"

read-only, you cannot change the value of the edit box (edit box becomes read-only but spinner control, if present is unaffected).

 

"False"

not read-only, characters can be entered into the edit box from the keypad.

 

right

All Controls

X coordinate in pixels, or on Android devices in Device Independent Pixels (DIP), for the right edge of the Control. Read-only.

 

stepvalue

Edit Control with spinner enabled

The amount by which the currently displayed value increases or decreases when one of the spinner buttons is clicked or tapped.

 

Text

All Controls which can display text except List Box and ListView Controls.

Not relevant to Timer, Panel and Group Controls.

String representing the text displayed in the Control. Note that this might not be the same as the actual value stored in the Control and which would be returned by the GetControlValue Scripting Method, e.g. when using a Date Picker Control where the displayed value may differ from the actual value depending upon the value of the Format Property of the Control.

For Date Picker Controls the value can be specified using any of the formats available to input values using the SetControlValue Scripting Method.

 

top

All Controls

Y coordinate in pixels, or on Android devices in Device Independent Pixels (DIP), for the top edge of the Control.

 

value

All Controls except Panel Controls

This Property contains the value of the Control.

Accessing this property directly is similar to using the GetControlValue and SetControlValue Scripting Methods.

 

visible

All Controls

Value indicating the visibility of the Control ("True" or "False").

 

width

All Controls

Width of the Control in pixels, or on Android devices in Device Independent Pixels (DIP).